package com.itheima.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAdvice {
    @Pointcut("execution(* com.itheima.dao.BookDao.update(..))")
    private void pt(){

    }

    @Around("pt()")
    public Object method(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("around before advice...");

        //表示对原始操作的调用
        Integer ret = (Integer)pjp.proceed();

        System.out.println("around after advice...");

        return ret+999;
    }
}
